list1 = [54, 26, 93, 17, 77, 31, 44, 55, 20]

list1 = [26, 54, 93, 17, 77, 31, 44, 55, 20]
list1 = [26, 54, 93, 17, 77, 31, 44, 55, 20]
list1 = [17, 26, 54, 93, 77, 31, 44, 55, 20]

# insertsort

list1 = [9, 5, 2, 6, 7, 10]
# 第一遍 list[1] 和 list[0] 比较 交换否? 交换完结束,不交换也结束

# 第二遍 list[2] 和list[1] 比较 交换否? 不交换结束, 交换的话, 走第一遍

n = len(list1)
for i in range(1, n):
    for j in range(i):
        if list1[i - j]<list1[i - j - 1] :
            list1[i - j], list1[i - j - 1] = list1[i - j - 1], list1[i - j]

print(list1)